package cn.edu.zjut.mina.po;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 玩家每局对战信息
 * @author 张宇翔
 */
@Table(name="t_playerBattleInfo")
@Entity
public class PlayerBattleInfo {
	private Integer playerBattleInfoId;//主键
	private String userId;//玩家Id
	//private Integer totalGameResultId;//外键
	private Integer credit;//当前积分
	private Integer youNiu;//玩家是否有牛
	private Integer niuNiu;//玩家是否牛牛
	private Integer wuHua;//玩家是否五花
	private Integer zhadan;//玩家是否炸弹
	private Integer sandaier;//玩家是否三带二
	private Integer shunzi;//玩家是否顺子
	//牌信息   范围 1-52         1表示方块1  14表示草花1  27表示红桃1   40表示黑桃1
	private Integer cardone;//第一张牌
	private Integer cardtwo;//第一张牌
	private Integer cardthree;//第一张牌
	private Integer cardfour;//第一张牌
	private Integer cardfive;//第一张牌
	@JSONField(serialize=false)
	private EveryGameResult everyGameResult;
	
	@GeneratedValue
	@Id
	public Integer getPlayerBattleInfoId() {
		return playerBattleInfoId;
	}
	public void setPlayerBattleInfoId(Integer playerBattleInfoId) {
		this.playerBattleInfoId = playerBattleInfoId;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public Integer getCredit() {
		return credit;
	}
	public void setCredit(Integer credit) {
		this.credit = credit;
	}
	public Integer getYouNiu() {
		return youNiu;
	}
	public void setYouNiu(Integer youNiu) {
		this.youNiu = youNiu;
	}
	public Integer getNiuNiu() {
		return niuNiu;
	}
	public void setNiuNiu(Integer niuNiu) {
		this.niuNiu = niuNiu;
	}
	public Integer getWuHua() {
		return wuHua;
	}
	public void setWuHua(Integer wuHua) {
		this.wuHua = wuHua;
	}
	public Integer getZhadan() {
		return zhadan;
	}
	public void setZhadan(Integer zhadan) {
		this.zhadan = zhadan;
	}
	public Integer getSandaier() {
		return sandaier;
	}
	public void setSandaier(Integer sandaier) {
		this.sandaier = sandaier;
	}
	public Integer getShunzi() {
		return shunzi;
	}
	public void setShunzi(Integer shunzi) {
		this.shunzi = shunzi;
	}
	public Integer getCardone() {
		return cardone;
	}
	public void setCardone(Integer cardone) {
		this.cardone = cardone;
	}
	public Integer getCardtwo() {
		return cardtwo;
	}
	public void setCardtwo(Integer cardtwo) {
		this.cardtwo = cardtwo;
	}
	public Integer getCardthree() {
		return cardthree;
	}
	public void setCardthree(Integer cardthree) {
		this.cardthree = cardthree;
	}
	public Integer getCardfour() {
		return cardfour;
	}
	public void setCardfour(Integer cardfour) {
		this.cardfour = cardfour;
	}
	public Integer getCardfive() {
		return cardfive;
	}
	public void setCardfive(Integer cardfive) {
		this.cardfive = cardfive;
	}
	
	@ManyToOne(cascade = CascadeType.PERSIST, optional=true,fetch = FetchType.LAZY)
	@JoinColumn(name="everyGameResult_id", referencedColumnName="everyGameResultId")
	public EveryGameResult getEveryGameResult() {
		return everyGameResult;
	}
	public void setEveryGameResult(EveryGameResult everyGameResult) {
		this.everyGameResult = everyGameResult;
	}
	
}
